<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-on的修饰符</title>
</head>
<body>

<div id="app">

<!--  停止冒泡 -->
  <div @click="btndiv">
    aaaa
    <button @click.stop="btnbtn">按钮1</button>
  </div>

<!--  阻止默认行为 -->
  <br>
  <form action="baidu">
    <input type="submit" value="提交" @click.prevent="submitclick" >
  </form>

  <br>
  <input type="text" @keyup.enter="keyup">

</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好'
    },
    methods: {
      btndiv() {
        console.log('btndiv');
      },
      btnbtn() {
        console.log("btnbtn");
      },
      submitclick() {
        console.log("submitclick");
      },
      keyup() {
        console.log("keyup");
      }
    }
  })
</script>
</body>
</html>
